package com.xishu.entity.foodpanda;

import com.xishu.annotation.dao.DefaultValue;
import com.xishu.annotation.dao.FieldMapping;
import com.xishu.annotation.lang.Lang;
import com.xishu.entity.AbstractEntity;
import com.xishu.entity.shop.SceneTimeConfig;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

@Api(description = "相当于场景")
@Entity(name = "menu")
@Table(indexes = {@Index(columnList = "shopId")})
@Data
public class Menu extends AbstractEntity {
    private static final long serialVersionUID = 7892025263044275169L;

    @ApiModelProperty(value = "归属的餐厅公司")
    private Long companyId;

    @ApiModelProperty(value = "分店的ID")
    private Long shopId;

    @ApiModelProperty(value = "标题名称")
    @Lang(key = "name")
    private String name;

    @Lang(key = "name")
    @ApiModelProperty(value = "标题名称-中文")
    private String name_zh;

    @Lang(key = "name")
    @ApiModelProperty(value = "标题名称-英文")
    private String name_en;

    @ApiModelProperty(value = "应用时间段配置,当前一个配置所有的星期XXX对应一个时间段，服务器端会做成动态的，支持每个星期XXX时间段不同")
    @Transient
    @FieldMapping(desField = "timeConfigJson", serialize = true)
    private List<SceneTimeConfig> timeConfigList;

    @FieldMapping(desField = "timeConfigList", serialize = false, genericType = "com.xishu.entity.shop.SceneTimeConfig")
    @Column(length = 2048)
    private String timeConfigJson;

    @ApiModelProperty(value = "描述")
    @Lang(key = "description", lang = "")
    private String description;

    @ApiModelProperty(value = "描述中文")
    @Lang(key = "description", lang = "zh")
    private String description_zh;

    @ApiModelProperty(value = "描述英文")
    @Lang(key = "description", lang = "en")
    private String description_en;

    @ApiModelProperty(value = "menu类型 ,1是Delivery, 2是Pick UP")
    @DefaultValue(defaultValue = "1")
    private Integer menuType;
}
